testMymath: main.o add.o sub.o mul.o div.o
	gcc libs/main.o libs/add.o libs/sub.o libs/mul.o libs/div.o -o bin/testMymath
main.o: src/main.c include/head.h
	gcc -c src/main.c -Iinclude -o libs/main.o
add.o: src/add.c include/head.h 
	gcc -c src/add.c -Iinclude -o libs/add.o
sub.o: src/sub.c include/head.h 
	gcc -c src/sub.c -Iinclude -o libs/sub.o
mul.o: src/mul.c include/head.h 
	gcc -c src/mul.c -Iinclude -o libs/mul.o
div.o: src/div.c include/head.h 
	gcc -c src/div.c -Iinclude -o libs/div.o


dllMymath: src/main.c libMymath.so include/head.h
	gcc -Iinclude -Llibs -lMymath src/main.c -o bin/dllMymath
libMymath.so: main.o add.o sub.o mul.o div.o
	gcc -shared -o libs/libMymath.so libs/*.o
dlladd.o: src/add.c include/head.h
	gcc -c -fPIC -Iinclude src/add.c -o libs/dlladd.o
dllsub.o: src/sub.c include/head.h
	gcc -c -fPIC -Iinclude src/sub.c -o libs/dllsub.o
dllmul.o: src/mul.c include/head.h
	gcc -c -fPIC -Iinclude src/mul.c -o libs/dllmul.o
dlldiv.o: src/div.c include/head.h
	gcc -c -fPIC -Iinclude src/div.c -o libs/dlldiv.o


clean:
	rm libs/*
	rm bin/*


static: testMymath
dll: dllMymath
